package com.sogeti.mentormatch.model
{
	import com.adobe.cairngorm.model.ModelLocator;
	
	import mx.collections.ArrayCollection;
	[Bindable]
	/**
	 * The MentorModelLocator class is the class we use to store all of our client state variables.
	 * These would be things like arrays that will populate datagrids on the screen, or state variables, such
	 * as which page the user is on, member vars stored in memory etc. 
	 */
	public class MentorModelLocator implements ModelLocator
	{
		private static var modelLocator : MentorModelLocator;
      
      public static function getInstance() : MentorModelLocator 
      {
      	if ( modelLocator == null )
      	{
      		modelLocator = new MentorModelLocator();
      	}
      		
      	return modelLocator;
      }
      
      //Constructor should be private but current AS3.0 does not allow it yet (?)...
      public function MentorModelLocator() 
      {	
         if ( modelLocator != null )
         {
         	throw new Error( "Only one MentorModelLocator instance should be instantiated" );	
         }
         
      }
      
      public var currentQuestion:int;
      
        //navigation state var static values
		public static const MASTER_VIEW_NOT_LOGGED_IN : String = "loginView";
		public static const MASTER_VIEW_LOGGED_IN : String = "loggedInView";
      
      	//Navigation state vars
      	public var masterNavigationStateString:String = MASTER_VIEW_NOT_LOGGED_IN;
      
      	public var practices:Array = [{label:"Java Practice -- we rock!", data:1},
			{label:"Microsoft Practice -- like the evil empire!", data:2},
			{label:"BA/PM Practice -- we like to make word docs!", data:3},
			{label:"Database Practice -- we do it on tables!", data:4},
			{label:"PLM Practice -- No one really knows what we do!", data:5},
			{label:"Sales Practice -- Selling stuff we cant explain everyday!", data:6},
			{label:"Management Practice -- we dont do the work, we wanna manage the work!", data:7}];
	
		public var mentorArray:ArrayCollection;
		
		//initialize method
		private function init():void
		{
			masterNavigationStateString = MASTER_VIEW_LOGGED_IN;
			fillQuestionAc();
			currentQuestion=0;
			
		}
		
		private function fillQuestionAc():void
		{
			/* questionService.findAll.addEventListener("result", fillQuestionAcHandler);
			questionService.addEventListener("fault", onFault); 
			questionService.findAll(); */
			//Need a better way to do this. Not on the model.
		}
      
	}
}